package com.aaa.pe.controller;

import com.aaa.common.entity.Book;
import com.aaa.common.entity.Personinfo;
import com.aaa.pe.service.PersoninfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * (Personinfo)表控制层
 *
 * @author makejava
 * @since 2020-07-23 14:40:05
 */
@RestController
@RequestMapping("person")
public class PersoninfoController {
    /**
     * 服务对象
     */
    @Autowired
    private PersoninfoService personinfoService;

    /**
     * 通过主键查询单条数据
     *
     * @return 单条数据
     */
    @GetMapping("selectAll")
    public Map selectAll() {
        List<Personinfo> persons = personinfoService.selectAll();
        List<Book> books = personinfoService.selectBook();
        Map map=new HashMap();
        map.put("persons",persons);
        map.put("books",books);
        return map;
    }

}